import tools from "@/common/tools.js";
import {
	post
} from '@/common/axios.js';
import {
	resetWithdrawalPassword, //提现密码重置
	sendMessage, //获取验证码
} from '@/common/path.js'
export default {
	//用户照片操纵
	namespaced: true,
	state: {
		userInfo: uni.getStorageSync('userInfo'),
	},
	getters: {

	},
	mutations: {

	},
	actions: {
		//获取验证码
		sendMessage({
			dispatch,
			commit,
			state
		}, args = {}) {
			post(sendMessage, args).then(res => {
				return new Promise((resolve, reject) => {
					tools.showToast(res.msg)
					resolve(res.code)//成功失败都返回自己处理
				})
				
			})
		},

		//重置 提现密码
		resetWithdrawalPassword({
			dispatch,
			commit,
			state
		}, args = {}) {
			post(resetWithdrawalPassword, args).then(res => {
				if (res.code == 0) {

				} else {
					tools.showToast(res.msg)

				}
			})
		}



	},
}
